<template>
  <div>
    <button @click="getDatas">获取数据</button>
    <data-table v-for="(item, index) in datas" :item='item' :key="index"/>
  </div>
</template>
<script>
  import dataTable from './data'
  export default{
    data() {
      return {
        datas:[{
          attr: 'ceshi',
          val: 'ceshi'
        },{
          attr: 'ceshi',
          val: 'ceshi'
        },{
          attr: 'ceshi',
          val: 'ceshi'
        },{
          attr: 'ceshi',
          val: 'ceshi'
        }]
      }
    },
    components: {
      dataTable
    },
    methods: {
      getDatas: function () {
        console.log(this.datas)
      }
    }
  }
</script>